﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Taobao.Tools2.Domain.EntityFramework.Mappings;

namespace Taobao.Tools2.Domain.EntityFramework
{
    public class ShopMapping:ModelMapping<Shop>
    {
        public ShopMapping()
            : base()
        {
            Map(d => d.ToTable("Shop"));
            Property(c => c.AppKey).HasColumnName("AppKey");
            Property(c => c.AppSecret).HasColumnName("AppSecret");
            Property(c => c.Name).HasColumnName("Name");
            Property(c => c.LastUpdatedDate).HasColumnName("Updated");
            Property(c => c.Show).HasColumnName("show");
            Property(c => c.Status).HasColumnName("status");
            Property(c => c.SessionKey).HasColumnName("SessionKey"); 
            Property(c => c.ID).HasColumnName("ShopId");
            HasKey(c => c.ID);

            Property(c => c.IsUpdateDetailScheduled).HasColumnName("IsUpdateDetailScheduled").IsOptional();
            Property(c => c.ScheduledUpdateTime).HasColumnName("ScheduledUpdateTime").IsOptional();
            Property(c => c.LastUpdatedDetailTime).HasColumnName("LastUpdatedDetailTime").IsOptional();
            Property(c => c.ScheduledUpdateCountEachDay).HasColumnName("ScheduledUpdateCountEachDay").IsOptional();
            Property(c => c.ScheduledUpdateCountToday).HasColumnName("ScheduledUpdateCountToday").IsOptional();


            Property(c => c.LastUpdateRefundsTimeByIncreasement).HasColumnName("LastUpdateRefundsTimeByIncreasement").IsOptional();
            Property(c => c.LastUpdateTradesTimeByIncreasement).HasColumnName("LastUpdateTradesTimeByIncreasement").IsOptional();
            Property(c => c.BeforeMinutesOfUpdateByIncreament).HasColumnName("BeforeMinutesOfUpdateByIncreament").IsOptional();
       
            //HasRequired<Sender>(s => s.Sender).WithOptional();
        }
    }
}
